<template>
  <div>
    <el-table :data="fleetData">
      <el-table-column label="车队名称" prop="name"/>
      <el-table-column label="机构id" prop="agencyId">
        <template slot-scope="scope">
          <el-select v-model="scope.row.agencyId" disabled>
            <el-option v-for="(item,index) in coreOrgAllData" :key="index" :label="item.name" :value="item.id"/>
          </el-select>
        </template>
      </el-table-column>
      <el-table-column label="负责人id">
        <template slot-scope="scope">
          <el-select v-model="scope.row.manager" disabled>
            <el-option v-for="(item,index) in userAllData" :key="index" :label="item.name" :value="item.id"/>
          </el-select>
        </template>
      </el-table-column>
      <el-table-column label="状态">
        <template slot-scope="scope">
          <p v-if="scope.row.status==1">正常</p>
          <p v-else-if="scope.row.status==0">禁用</p>
        </template>
      </el-table-column>
    </el-table>

  </div>
</template>

<script>
import fleet from '@/api/base/fleet/index'
import coreOrg from '@/api/base/coreOrg/index'
import user from '@/api/base/globalUser/index'
export default {
  name: 'index',
  data() {
    return {
      fleetData: [],
      userAllData: [],
      coreOrgAllData: []
    }
  }, methods: {
    getUserAllData() {
      user.queryAll().then(data => {
        this.userAllData = data.data
      })
    },
    getCoreOrgALlData() {
      coreOrg.queryAll().then(data => {
        this.coreOrgAllData = data.data
      })
    },
    findAll() {
      fleet.findAll().then(data => {
        this.fleetData = data.data
      })
    }
  }, mounted() {
    this.findAll();
    this.getUserAllData();
    this.getCoreOrgALlData();
  }
}
</script>

<style scoped>

</style>
